<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/10/26
 * Time: 14:47
 */

namespace app\api\validate;


class IdsCollection extends BaseValidate
{

    protected $rule = [
        'ids'=>'require|CheckIds'
    ];

    public function CheckIds($value,$rule,$data=[],$field){
        $arr = explode(',',$value);
        if(!$arr){
            return false;
        }
        foreach ($arr as $item){
            if(!$this->checkID($item)){
                return false;
            }
        }

        return true;
    }

}